import { get, post } from "./index";

// 轮播图
export const getBanner = () => get("/getbanner");

// 首页的分类
export const getHomeCate = () => get("/getcate");

//首页的商品列表
export const getHomeGoods = () => get("/gethortgoods");

// 获取所有分类信息
export const getCate = () => get("/getcates");

// 获取二级分类下的所有商品
export const getGoodsList = (params) => get("/getgoodlist", params);

// 商品详情
export const getDetail = (params) => get("/getgoodsinfo", params);

// 登录
export const login = (data) => post("/login", data);

// 注册
export const register = (data) => post("/register", data);

// 购物车列表
export const cartList = (params) => get("/cartlist", params);

// 购物车修改
export const cartEdit = (data) => post("/cartedit", data);

// 购物车删除
export const cartDel = (data) => post("/cartdelete", data);

// 购物车添加
export const cartAdd = (data) => post("/cartadd", data);

// 搜索（like模糊搜索）
export const Search = (params) => get("/search", params);

// 订单生成
export const orderAdd = (data) => post("/orderadd", data);

// 订单列表
export const orderList = (params) => get("/orderlist", params);

// 地址查询
export const addresslist = (params) => get('/addresslist', params)

// 地址添加
export const addressadd = (data) => post('/addressadd', data)
// 地址的编辑
export const addressedit = (data) => post('/addressedit', data)
// 地址的删除
export const addressremove = (data) => post('/addressremove', data)
// 订单生成
export const orderadd = (data) => post('/orderadd', data)
